package com.mrd.gtimp.business.service;

import com.mrd.base.BaseBiz;
import com.mrd.gtimp.business.entity.DeclaRelastionship;
import com.mrd.gtimp.business.repository.DeclaRelastionshipDao;
import com.mrd.spring.repository.BaseRepository;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * Created by dark on 17/7/14.
 */
@Service
public class DeclaRelastionshipBiz extends BaseBiz<DeclaRelastionship> {
    @Override
    @Resource
    @Qualifier("declaRelastionshipDao")
    public void setBaseRepository(BaseRepository<DeclaRelastionship, String> baseRepository) {
        this.baseRepository = baseRepository;
    }

    @Resource
    private DeclaRelastionshipDao declaRelastionshipDao;

    public DeclaRelastionship findLastByDeclaId(String declaId) throws Exception {
        if (StringUtils.isEmpty(declaId)) {
            throw new Exception("");
        }
//        List<DeclaRelastionship> list = declaRelastionshipDao.findByDeclaId(declaId);
//        if (CollectionUtils.isNotEmpty(list) && list.size() > 0) {
//            return list.get(0);
//        }
        return null;
    }
}
